// Decompiled by GOOSIN CO,LTD Copyright 2010 Pavel Kouznetsov.
// home page: http://www.Goosin.net
// Decompiler options: packimports(3) fieldsfirst ansi space 
// Source File Name:   delete_ok.java

package finance.teller.checkup;

import include.nseer_db.nseer_db_backup1;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.*;
import javax.servlet.jsp.JspFactory;

public class delete_ok extends HttpServlet
{

	public delete_ok()
	{
	}

	public synchronized void service(HttpServletRequest request, HttpServletResponse response)
		throws IOException, ServletException
	{
		HttpSession dbSession = request.getSession();
		JspFactory _jspxFactory = JspFactory.getDefaultFactory();
		javax.servlet.jsp.PageContext pageContext = _jspxFactory.getPageContext(this, request, response, "", true, 8192, true);
		javax.servlet.ServletContext dbApplication = dbSession.getServletContext();
		java.io.PrintWriter out = response.getWriter();
		HttpSession session = request.getSession();
		nseer_db_backup1 finance_db = new nseer_db_backup1(dbApplication);
		try
		{
			if (finance_db.conn((String)dbSession.getAttribute("unit_db_name")))
			{
				String file_id = request.getParameter("sTa");
				String sql = (new StringBuilder("update finance_bill set delete_tag='1' where file_id=")).append(file_id).append(" and checkup_tag!='0'").toString();
				finance_db.executeUpdate(sql);
				sql = (new StringBuilder("update finance_voucher set delete_tag='1' where chain_id=")).append(file_id).append(" and checkup_tag!='0'").toString();
				finance_db.executeUpdate(sql);
				finance_db.commit();
				finance_db.close();
			} else
			{
				response.sendRedirect("error_conn.htm");
			}
		}
		catch (Exception ex)
		{
			ex.printStackTrace();
		}
	}
}
